]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Make NMWirelessDialogItem a subclass of St.BoxLayout
authorJonas Dreßler <verdre@v0yd.nl>
Wed, 22 May 2019 16:27:15 +0000 (18:27 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 22 May 2019 19:55:49 +0000 (19:55 +0000)
In commit 41dd744b7429358a4534e603570d4d1c8acc161b this item was
confused with a popup menu item. To fix this, make NMWirelessDialogItem
inherit from St.BoxLayout instead of adding the item.actor variable back
again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/551

js/ui/status/network.js

index 24e612b4fe98854f083cac736cdc46a4dd474fa7..20a6317a5fd4c21c97aab348142c92a8da1afcef 100644 (file)
@@ -613,31 +613,36 @@ var NMDeviceBluetooth = class extends NMConnectionDevice {
     }
 };
 
-var NMWirelessDialogItem = class {
-    constructor(network) {
+var NMWirelessDialogItem = GObject.registerClass({
+    Signals: {
+        'selected': {},
+    }
+}, class NMWirelessDialogItem extends St.BoxLayout {
+    _init(network) {
         this._network = network;
         this._ap = network.accessPoints[0];
 
-        this.actor = new St.BoxLayout({ style_class: 'nm-dialog-item',
-                                        can_focus: true,
-                                        reactive: true });
-        this.actor.connect('key-focus-in', () => { this.emit('selected'); });
+        super._init({ style_class: 'nm-dialog-item',
+                      can_focus: true,
+                      reactive: true });
+
+        this.connect('key-focus-in', () => { this.emit('selected'); });
         let action = new Clutter.ClickAction();
-        action.connect('clicked', () => { this.actor.grab_key_focus(); });
-        this.actor.add_action(action);
+        action.connect('clicked', () => { this.grab_key_focus(); });
+        this.add_action(action);
 
         let title = ssidToLabel(this._ap.get_ssid());
         this._label = new St.Label({ text: title });
 
-        this.actor.label_actor = this._label;
-        this.actor.add(this._label, { x_align: St.Align.START });
+        this.label_actor = this._label;
+        this.add(this._label, { x_align: St.Align.START });
 
         this._selectedIcon = new St.Icon({ style_class: 'nm-dialog-icon',
                                            icon_name: 'object-select-symbolic' });
-        this.actor.add(this._selectedIcon);
+        this.add(this._selectedIcon);
 
         this._icons = new St.BoxLayout({ style_class: 'nm-dialog-icons' });
-        this.actor.add(this._icons, { expand: true, x_fill: false, x_align: St.Align.END });
+        this.add(this._icons, { expand: true, x_fill: false, x_align: St.Align.END });
 
         this._secureIcon = new St.Icon({ style_class: 'nm-dialog-icon' });
         if (this._ap._secType != NMAccessPointSecurity.NONE)
@@ -669,8 +674,7 @@ var NMWirelessDialogItem = class {
         else
             return 'network-wireless-signal-' + signalToIcon(this._ap.strength) + '-symbolic';
     }
-};
-Signals.addSignalMethods(NMWirelessDialogItem.prototype);
+});
 
 var NMWirelessDialog = class extends ModalDialog.ModalDialog {
     constructor(client, device) {